<?php defined('InShopNC') or exit('Access Invalid!');?>
<div class="ncm-container">
<?php include template('member/member_left');?>
  <div class="right-layout">
    
<div class="ncm-flow-layout" id="ncmComplainFlow">
  <div class="ncm-flow-container">
    <div class="title">
      <h3>交易投诉申请</h3>
    </div>
    <div class="ncm-flow-step">
      <dl id="state_new" class="step-first current">
        <dt>新投诉</dt>
        <dd class="bg"></dd>
      </dl>
      <dl id="state_appeal" class="">
        <dt>待申诉</dt>
        <dd class="bg"> </dd>
      </dl>
      <dl id="state_talk" class="">
        <dt>对话中</dt>
        <dd class="bg"> </dd>
      </dl>
      <dl id="state_handle" class="">
        <dt>待仲裁</dt>
        <dd class="bg"> </dd>
      </dl>
      <dl id="state_finish" class="">
        <dt>已完成</dt>
        <dd class="bg"> </dd>
      </dl>
    </div>
    <div class="ncm-default-form">
        <h3><?php echo $lang['complain_message'];?></h3>
        <dl>
          <dt><?php echo $lang['complain_accused'].$lang['nc_colon'];?></dt>
          <dd><?php echo $output['order_info']['store_name'];?></dd>
          <dt><?php echo $lang['complain_subject_content'].$lang['nc_colon'];?></dt>
          <dd><?php echo $output['complain_info']['complain_subject_content'];?></dd>
          <dt><?php echo $lang['complain_datetime'].$lang['nc_colon'];?></dt>
          <dd><?php echo date('Y-m-d H:i:s',$output['complain_info']['complain_datetime']);?></dd>
          <dt><?php echo $lang['complain_content'].$lang['nc_colon'];?></dt>
          <dd><?php echo $output['complain_info']['complain_content'];?></dd>
          <dt><?php echo $lang['complain_evidence'].$lang['nc_colon'];?></dt>
          <dd>
                            <?php
                        if(empty($output['complain_info']['complain_pic1'])&&empty($output['complain_info']['complain_pic2'])&&empty($output['complain_info']['complain_pic3'])) {
                            echo $lang['complain_pic_none'];
                            if((intval($output['complain_info']['complain_state'])<99) && ($output['complain_info']['accuser_id'] == $_SESSION['member_id'])) {
                            ?>
                            <a class="ncm-btn-mini ncm-btn-orange" href="javascript:void(0)" nc_type="dialog" dialog_title="<?php echo $lang['complain_add_pic'];?>" dialog_id="complain_add_pic" dialog_width="400" uri="index.php?act=member_complain&op=complain_add_pic&complain_id=<?php echo $output['complain_info']['complain_id']; ?>" id="complain_add_pic"><i class="icon-cloud-upload "></i><?php echo $lang['complain_add_pic'];?></a>
                            <?php
                            }
                        }
                        else {
                            //$pic_link = SHOP_SITE_URL.'/index.php?act=show_pics&type=complain&pics=';
                            if(!empty($output['complain_info']['complain_pic1'])) {
                                $pic_link .= $output['complain_info']['complain_pic1'].'|';
                            }
                            if(!empty($output['complain_info']['complain_pic2'])) {
                                $pic_link .= $output['complain_info']['complain_pic2'].'|';
                            }
                            if(!empty($output['complain_info']['complain_pic3'])) {
                                $pic_link .= $output['complain_info']['complain_pic3'].'|';
                            }
                            $pic_link = rtrim($pic_link,'|');
                    ?>
    <a href="<?php echo SHOP_SITE_URL;?>/index.php?act=show_pics&type=complain&pics=<?php echo $pic_link;?>" target="_blank" title="点击查看大图" onMouseOver="toolTip('<img src=<?php echo UPLOAD_SITE_URL;?>/shop/complain/<?php echo $pic_link;?>>')" onMouseOut="toolTip()" ><?php echo $lang['complain_pic_view'];?></a>
    <?php } ?>
          </dd>
        </dl>
      <?php
    if(!empty($output['complain_info']['appeal_message'])) {
         include template('member/complain_appeal.info');
    }
    if(intval($output['complain_info']['complain_state'])>20) {
         include template('member/complain_talk.info');
    }
    if(!empty($output['complain_info']['final_handle_message'])) {
        include template('member/complain_finish.info');
    }
     ?>
                        <div class="bottom"><a href="javascript:history.go(-1);" class="ncm-btn"><i class="icon-reply"></i>返回列表</a></div>
    </div>
  </div>
      <?php
         include template('member/complain_order.info');
     ?>
</div>


<script type="text/javascript">
$(document).ready(function(){
   //$('a[nctype="nyroModal"]').nyroModal();
    var state = <?php echo empty($output['complain_info']['complain_state'])?0:$output['complain_info']['complain_state'];?>;
    if(state == 20 ){
        $("#state_appeal").addClass('current');
    }
    if(state == 30 ){
        $("#state_appeal").addClass('current');
        $("#state_talk").addClass('current');
    }
    if(state == 40 ){
        $("#state_appeal").addClass('current');
        $("#state_talk").addClass('current');
        $("#state_handle").addClass('current');
    }
    if(state == 99 ){
        $("#state_appeal").addClass('current');
        $("#state_talk").addClass('current');
        $("#state_handle").addClass('current');
        $("#state_finish").addClass('current');
    }
    $("#add_pic_submit_button").click(function(){
    	if($("#post_add_pic_form").valid()){
    		ajaxpost('post_add_pic_form', '', '', 'onerror');
        }
    });
    $('#post_add_pic_form').validate({
        errorPlacement: function(error, element){
            $(element).next('.field_notice').hide();
            $(element).after(error);
        },
            rules : {
                input_complain_pic1 : {
                    accept : 'jpg|jpeg|gif|png'
                },
                input_complain_pic2 : {
                    accept : 'jpg|jpeg|gif|png'
                },
                input_complain_pic3 : {
                    accept : 'jpg|jpeg|gif|png'
                }
            },
                messages : {
                    input_complain_pic1: {
                        accept : '图片必须是jpg/jpeg/gif/png格式'
                    },
                    input_complain_pic2: {
                        accept : '图片必须是jpg/jpeg/gif/png格式'
                    },
                    input_complain_pic3: {
                        accept : '图片必须是jpg/jpeg/gif/png格式'
                    }
                }
    });
});
</script>



</div>
  <div class="clear"></div>
</div>